<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <audio src="" autoplay controls="controls"></audio>
    <button>播放</button>
    <button>暂停</button>
    <!-- src播放路径 -->
    <!-- controls音频播放器的控制面板:必加 -->
    <!-- autoplay:自动播放 -->
    <!-- loop：循环 -->
    <!-- play播放 -->
    <!-- pause暂停-->
    <script>
        var btn = document.getElementsByTagName("button")[0];
        var btn1 = document.getElementsByTagName("button")[1];
        var audio = document.getElementsByTagName("audio")[0];
        btn.onclick = function() {
            audio.play();
        }
        btn1.onclick = function() {
            audio.pause();
        }
    </script>

</body>

</html>